#pragma once

#include "memory"

namespace hsby {
    template<typename Type>
    struct PtrCreator {
        template<typename ...ArgsType>
        std::shared_ptr<Type> operator()(ArgsType ...args) {
            return std::shared_ptr<Type>(new Type(args...));
        }
    };

    template<typename Type>
    struct PtrCreator<Type[]> {
        std::shared_ptr<Type> operator()(size_t size) {
            return std::shared_ptr<Type>(new Type[size], [](char* ptr){delete[] ptr;});
        }
    };
}// namespace hsby